package text_2023_09_30;

/**
 * @author Vv
 * @version 1.0
 * @project coding_learn
 * @description
 * @date 2023/9/30 18:08:59
 */
class T implements Runnable{

    @Override
    public void run() {
        for(int i = 0;i<200;i++){
            System.out.println( "线程" + Thread.currentThread().getName() + " 正在运行");
        }
    }
}
public class Demo2 {
    public static void main(String[] args) {
        T t1 = new T();
        T t2 = new T();
        Thread thread1 = new Thread(t1);
        thread1.setName("线程一");
        thread1.setPriority(10);
        Thread thread2 = new Thread(t2);
        thread2.setName("线程2");
        thread2.setPriority(6);
        thread1.start();
        thread2.start();
    }
}

